#include "graph.h"
int main(int argc,char *argv[])
{
  
  Graph mygraph;
  int nodeNumber = 0;
  read_graph(&mygraph,argv[1]);
  int visited[mygraph.MaxSize + 1];
  int value = 1;
  int valueMin = mygraph.table[1].outdegree;
  char* namesMin = mygraph.table[1].name;
  for(int i = 2; i < mygraph.MaxSize + 1; i++)
  {
    if(mygraph.table[i].outdegree != 0)
    {
      if((valueMin > mygraph.table[i].outdegree) || valueMin == 0)
      {
        printf("%d\n", value);
        namesMin = mygraph.table[i].name;
        valueMin = mygraph.table[i].outdegree;
      }//if
    }//if
  }
  if(valueMin == 0)
  {
    printf("There is no smallest out-degree Node\n\n");
  }
  else
  {
    for(int i = 0; i < mygraph.MaxSize + 1; i++)
    {
      visited[i] = 0;
    }
    //int high[2];
    Value high;
    high.bestCount = 0;
    high.bestNode = 0;    

    Value high1;
    high1.bestCount = 0;
    high1.bestNode = 0;    
    //printf("%d\n", valueMin);
    depth_first(&mygraph, visited, value, nodeNumber, &high);
    printf("\nThe depth first search: \n");
    printf("The start point is %s\n", mygraph.table[value].name);
    printf("The best out degree Node is %s\n", mygraph.table[high.bestNode].name);
    printf("The number of Node is %d\n", high.bestCount);

    breadth_first(&mygraph, value, &high1);
    printf("\nThe breadth first search: \n");
    printf("The start point is %s\n", mygraph.table[value].name);
    printf("The best out degree Node is %s\n", mygraph.table[high1.bestNode].name);
    printf("The number of Node is %d\n", high1.bestCount);
  } 
}//main

